#include "NewIO.h"
#include "CacheSearch.h"
#include "ComponentsHolder.h"
NewIO::NewIO(double actionTime, ExtentIO* data): Event(actionTime, data)
{
}


NewIO::~NewIO(void)
{
}
bool NewIO::doAction()
{
	Cache* cache = ComponentsHolder::getInstance()->getCache();
	EventsHandler* handler = ComponentsHolder::getInstance()->getEventsHandler();
	double actionTime = cache->getNextTime(); // calculate action time
	Event* cacheSearch = new CacheSearch(actionTime, _data);

	handler->addEvent(cacheSearch);
	return true;
}